%% @author me
%% @doc @todo Add description to sc_sup.


-module(sc_element_sup).
-behaviour(supervisor).
%% ====================================================================
%% API functions
%% ====================================================================
-export([start_child/2, start_link/0]).

-export([init/1]).
-define(SERVER,?MODULE).
%% ====================================================================
%% Internal functions
%% ====================================================================

start_link() ->
	supervisor:start_link({local,?SERVER}, ?MODULE, []).
start_child(Value,LeaseTime) ->
	supervisor:start_child(?SERVER, [Value,LeaseTime]).

init([]) ->
	Element= {sc_element,{sc_element,start_link,[]},
			 temporary,brutal_kill,worker,[sc_element]},
	Children =[Element],
	RestartStraegy={simple_one_for_one,0,1},
	{ok,{RestartStraegy,Children}}.
